#include <stdio.h>
int main(void)
{   int i=0,n,data[100],num=0,max;
    scanf("%d",&n);
	scanf("%d",&data[i]);
    max=data[i];
    for(i=1;i<n;i++)
       {scanf("%d",&data[i]);
       if(data[i]>=max){max=data[i];}
	   }
	for(i=0;i<n;i++)if(data[i]==max)num++;
	printf("%d",num);
	return 0;
}
